<script src="js/generate/datasource.js"></script>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
    <legend>数据源管理</legend>
</fieldset>
<form id="searchForm" class="layui-form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">数据源名称</label>
            <div class="layui-input-inline" style="width: 120px;">
                <input type="text" name="hbgdsName" placeholder="请输入数据源名称"
                       autocomplete="off"
                       class="layui-input">
            </div>
            <button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="datasourceSearch"
                    style="margin-left: 15px;"
            >查询
            </button>
        </div>
    </div>
</form>
<table id="datasourceTable" lay-filter="datasourceTable"></table>
<div id="datasourceTableToolBar" style="display: none;">
    <div class="layui-inline" lay-event="add" title="新增"><i class="layui-icon layui-icon-add-1"></i></div>
</div>
<div id="datasourceTableItemToolBar" style="display: none;">
    <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="edit" title="编辑">&#xe642;</a>
    &nbsp;&nbsp;
    <a class="layui-icon" href="javascript:void(0);" style="font-size: 20px;" lay-event="remove" title="删除">&#xe640;</a>
</div>
<div id="popLayer" style="display: none;">
    <div id="datasourceDiv" class="popLayer" style="display: none;">
        <form id="datasourceForm" class="layui-form" lay-filter="datasourceForm" style="width: 608px;margin-top: 30px;">
            <input type="hidden" name="hbgdsId"/>
            <div class="layui-form-item">
                <label class="layui-form-label">数据源名称</label>
                <div class="layui-input-block">
                    <input type="text" name="hbgdsName" required lay-verify="required" placeholder="请输入数据源名称"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">数据源类型</label>
                <div class="layui-input-block">
                    <select id="sourceType" name="sourceType" lay-verify="required">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">IP</label>
                    <div class="layui-input-block">
                        <input type="text" name="sourceIp" placeholder="禁止使用localhost和127.0.0.1"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">端口</label>
                    <div class="layui-input-block">
                        <input type="text" name="sourcePort" placeholder="请输入端口"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">账号</label>
                    <div class="layui-input-block">
                        <input type="text" name="sourceAccount" placeholder="请输入账号"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-block">
                        <input type="text" name="sourcePwd" placeholder="请输入密码"
                               autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">库名</label>
                <div class="layui-input-block">
                    <input type="text" name="sourceDbname" placeholder="请输入库名"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">自定义url</label>
                <div class="layui-input-block">
                    <input type="text" name="sourceUrl"
                           placeholder="例：jdbc:mysql://192.168.1.20:3306/test?serverTimezone=Asia/Shanghai"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">数据源说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="请输入数据源说明"
                              class="layui-textarea"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: right">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="datasourceSave">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <div id="datasourceMenuAssignDiv" class="popLayer" style="display: none;width: 450px;">
        <div style="width: 450px;">
            <div id="datasourceMenuAssignTree" style="height:320px; margin-top: 15px;margin-left: 20px;"></div>
            <div class="layui-form-item">
                <div style="text-align: center;">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="datasourceMenuAssign">分配</button>
                </div>
            </div>
        </div>
    </div>
</div>